package group.teachingmanagerbk.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import group.teachingmanagerbk.entity.po.Score;
import group.teachingmanagerbk.entity.vo.score.ScoreVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface ScoreMapper extends BaseMapper<Score> {

    /* 查询学生所有成绩 */
    @Select("select c.name as course, cs.score as score " +
            "from courses_students cs left join course c " +
            "on cs.course_id = c.course_id " +
            "where cs.student_id = #{id} ")
    List<ScoreVo> selectAllScore(int id);

}
